/* 
 * Author      		: Adnin Devit CF 
 * Date Created		: 31-Maret-2011 
 * Date Modified	: 6-April-2011 
 * Version			: 1.1 
 * */
package jtk.project4.fleet.field;

import javax.swing.SortOrder;

import org.hsqldb.Table;

//import jtk.project4.fleet.domain.MaintenanceHistory;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.TableField.AutoResizeMode;

public class MaintenanceHistoryRepairTableField extends GroupControl<String>{
	
	private TableField<String> repairTable;
	public MaintenanceHistoryRepairTableField(String bindID){
		//setTitle("header.MaintenanceHistory");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		repairTable = new TableField<String>("repairTable","Repair");
		//repairTable.setTitle("MaintenanceHistory.header.table");
		repairTable.setAutoResizeMode(AutoResizeMode.AUTOFIT);
		repairTable.getSelectionValues();
		
		repairTable.addColumn("label.date","date");
		repairTable.addColumn("label.repairs","reapair");
		repairTable.addColumn("label.partCost","partCost");
		repairTable.addColumn("label.laborCost","laborCost");
		repairTable.addColumn("label.totalCost","totalCost");
		
		repairTable.sort("date", SortOrder.ASCENDING);
	}
	
	private void createLayout(){
		setLayout (new FormLayout())
		.addField(repairTable);	
	}
}
